package com.cq.hd.common.enums.biz;

import lombok.Getter;

/**
 * @description: 是否是多商户通用券(1-否，2-是)
 * @author: mYunYu
 * @date: 2021/8/23 14:28
 * @version: v1.0
 */
public enum MulStateEnum {

    NO(1, "否"),
    YES(2, "是"),
    ;

    @Getter
    private final Integer value;

    @Getter
    private final String name;

    MulStateEnum(Integer value, String name) {
        this.value = value;
        this.name = name;
    }

    public static MulStateEnum typeOf(Integer value) {
        MulStateEnum[] values = MulStateEnum.values();
        for (MulStateEnum v : values) {
            if (v.value.equals(value)) {
                return v;
            }
        }
        return null;
    }

    public static MulStateEnum typeOf(String name) {
        MulStateEnum[] values = MulStateEnum.values();
        for (MulStateEnum v : values) {
            if (v.name.equals(name)) {
                return v;
            }
        }
        return null;
    }

}
